'use strict';

export default function softwareCopyright(state = {}, action) {
  switch (action.type) {
    case 'GET_SOFTWARE_COPYRIGHT_LIST_SUCCESS':
      return { ...state, softwareCopyrightList: action.payload };
    case 'GET_SOFTWARE_COPYRIGHT_LIST_FAILURE':
      return { ...state, softwareCopyrightList: null, error: action.payload };
      
    case 'CREATE_SOFTWARE_COPYRIGHT_SUCCESS':
      return { ...state, createSoftwareCopyrightResult: action.payload };
    case 'CREATE_SOFTWARE_COPYRIGHT_FAILURE':
      return { ...state, createSoftwareCopyrightResult: null, error: action.payload };
      
    case 'EDIT_SOFTWARE_COPYRIGHT_SUCCESS':
      return { ...state, editSoftwareCopyrightResult: action.payload };
    case 'EDIT_SOFTWARE_COPYRIGHT_FAILURE':
      return { ...state, editSoftwareCopyrightResult: null, error: action.payload };
      
    case 'DELETE_SOFTWARE_COPYRIGHT_SUCCESS':
      return { ...state, deleteSoftwareCopyrightResult: action.payload };
    case 'DELETE_SOFTWARE_COPYRIGHT_FAILURE':
      return { ...state, deleteSoftwareCopyrightResult: null, error: action.payload };
      
    case 'IMPORT_SOFTWARE_COPYRIGHT_SUCCESS':
      return { ...state, importSoftwareCopyrightResult: action.payload };
    case 'IMPORT_SOFTWARE_COPYRIGHT_FAILURE':
      return { ...state, importSoftwareCopyrightResult: null, error: action.payload };
      
    case 'EXPORT_SOFTWARE_COPYRIGHT_SUCCESS':
      return { ...state, exportSoftwareCopyrightResult: action.payload };
    case 'EXPORT_SOFTWARE_COPYRIGHT_FAILURE':
      return { ...state, exportSoftwareCopyrightResult: null, error: action.payload };
      
    case 'GET_SOFTWARE_COPYRIGHT_TEMPLATE_SUCCESS':
      return { ...state, softwareCopyrightTemplate: action.payload };
    case 'GET_SOFTWARE_COPYRIGHT_TEMPLATE_FAILURE':
      return { ...state, softwareCopyrightTemplate: null, error: action.payload };
      
    default:
      return state;
  }
} 